package com.example.myapplication.test;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.myapplication.R;
import com.example.myapplication.test2.GroupListAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述: { 拼团弹窗的dialog }
 *
 * @GitHub： https://github.com/JamesYang1624
 * @email： ywzst30@163.com
 * @CreateDate: 2019/12/23 17:04
 * @Author JamesYang
 */
@SuppressLint("Registered")
public class GroupBuyDialogActivity extends AppCompatActivity {

    TextView mTvDialogTtile;
    ImageView mIvCloseDialog;
    RecyclerView mRecyclerViewVertical;
    TextView mTvFightNumberAndTime;
    TextView mTvToFight;
    LinearLayout mLlToGroupBuy;
    private CourseFightAdapter mAdapter;
    private GroupListAdapter mCAdapter;
    private List<Long> mAssembleList;

    public static void launch(Context activity) {
        Intent intent = new Intent(activity, GroupBuyDialogActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_groupbuydialog);
        initView();
    }

    protected void initView() {
        mTvDialogTtile = findViewById(R.id.tvDialogTtile);
        mIvCloseDialog = findViewById(R.id.ivCloseDialog);
        mRecyclerViewVertical = findViewById(R.id.recyclerViewVertical);
        mTvFightNumberAndTime = findViewById(R.id.tvFightNumberAndTime);
        mTvToFight = findViewById(R.id.tvToGroupBug);
        mLlToGroupBuy = findViewById(R.id.llToGroupBuy);
        mAssembleList = new ArrayList<>();
        mAssembleList.add(1621167698L/1000);
        mAssembleList.add(1621164098L/1000);
        mAssembleList.add(1621052498L);
        mAssembleList.add(1620188498L);
        mAssembleList.add(1617596498L);
        mAssembleList.add(1637596498L);
        mAssembleList.add(1647596498L);
        mAssembleList.add(1657596498L);
        mAssembleList.add(1667596498L);
        mAssembleList.add(1677596498L);
        mAssembleList.add(1687596498L);
        mAssembleList.add(1689596498L);
        mAssembleList.add(1680596498L);
        mAssembleList.add(1681596498L);
        mAssembleList.add(1682596498L);
        mAssembleList.add(1684596498L);
        mAssembleList.add(1685596498L);
        mAssembleList.add(1686596498L);
        mAssembleList.add(1687596498L);
        mAssembleList.add(1688596498L);
        mAssembleList.add(1694596498L);
        mAssembleList.add(1604596498L);
        mAssembleList.add(1624596498L);
        mAssembleList.add(1614596498L);
        mAssembleList.add(1634596498L);
        mAssembleList.add(1654596498L);
        mAssembleList.add(1604596498L);
        mAssembleList.add(1664596498L);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        mRecyclerViewVertical.setLayoutManager(manager);
        mCAdapter = new GroupListAdapter();
//        mCAdapter.setNewData(mAssembleList);
        mRecyclerViewVertical.setAdapter(mCAdapter);
//        mAdapter = new CourseFightAdapter(this, mAssembleList);
//        mRecyclerViewVertical.setAdapter(mAdapter);
    }

}
